
README:

The code in this directory will replicate the tables, figures, and calculations referenced in the paper and online appendix of “Race, Diversity, and the Development of Political Attitudes on College Campuses.”
 
Requirements: 
 
The code should be run using R version 4.3.1 or earlier. The scripts were tested on the denoted versions of the packages. 
· ggplot2 3.4.4
· ggpubr 0.6.0
· gridExtra 2.3
· lme4 1.1-34
· lmerTest 3.1-3
· MatchIt 4.5.5
· psych 2.3.6
· readxl 1.4.3
· Rmisc 1.5.1
· stats 4.3.1
· stargazer 5.2.3
· texreg 1.39.3
 

Instructions:
 
Download the replication files and make a note of the path. Open an R session. 

The code “Study 1 replication code.R” will call all the necessary files to reproduce all figures and tables in the paper and appendix associated with Study 1. 

The code “Study 2 replication code.R” will call all the necessary files to reproduce all figures and tables in the paper and appendix associated with Study 2. 

Note: Some tables and figures will be printed to PDF or HTML files. Others can be viewed directly in the R Terminal.
 
Datasets:
 
The replication archive contains two CSV datasets: “study1data.csv” contains data from Study 1 and “study2data.csv” contains data from Study 2. 

The Excel files "rep_ttests_grapha.xlsx" and "rep_ttests_grapha.xlsx" are used to create Figure 4 and Appendix Figure B1.
 
Codebooks:

Codebooks with variable names, descriptions and question wording are included with the replication files: "Study 1 Codebook.pdf" for Study 1 and "Study 2 Questionnaire and Codebook.pdf" for Study 2.
